<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>导入数据</title>
    <link rel="stylesheet" type="text/css" href="./css/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="./css/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="./css/demo.css">
    <script type="text/javascript" src="./js/jquery.min.js"></script>
    <script type="text/javascript" src="./js/jquery.easyui.min.js"></script>
    <style>
        .main{
            text-align: center; /*让div内部文字居中*/
            background-color: #fff;
            border-radius: 20px;
            width:400px;
            height: 350px;
            margin: auto;
            padding:30px 60px;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
    </style>
</head>
<body style="text-align:center;">
    <div style="margin:20px 0;"></div>
    <input class="easyui-searchbox" data-options="prompt:'',menu:'#mm',searcher:doSearch" style="width:300px"></input>
    <div id="mm">
        <div data-options="name:'goodsName'">商品名称</div>
        <!--<div data-options="name:'goodsId'">观麦商品ID</div>-->
    </div>
    <div class="main" title="商品信息" style="width:400px;">
        <div style="margin-bottom:20px">
            <div>商品名称:</div>
            <input class="" type="text" id="sGoodsDesc" style="width:100%;height:32px">
        </div>
        <div style="margin-bottom:20px">
            <div>商品规格:</div>
            <input class="" type="text" id="sSpec" style="width:100%;height:32px">
        </div>
        <div style="margin-bottom:20px">
            <div>观麦编码:</div>
            <input class="" type="text" id="sGoodsNO2" style="width:100%;height:32px">
        </div>
        <div style="margin-bottom:20px">
            <div>美菜编码:</div>
            <input class="" type="text" id="sGoodsNO3" style="width:100%;height:32px">
        </div>
        <div>
            <a href="#" class="easyui-linkbutton" id="changeGoodsInfo" iconCls="icon-ok" style="width:60%;height:32px">确认修改</a>
        </div>
    </div>


    <script>
        function doSearch(value,name){
            $.ajax({
                url:'getTGoodsInfo',
                type:"POST",
                dataType:"json",
                data:{
                    name:name,
                    value:value
                },
                //鸭胗 1kg*10袋*箱
                success:function(data) {
                    $("#sGoodsDesc").val(data.GoodsDesc);
                    $("#sSpec").val(data.Spec);
                    $("#sGoodsNO2").val(data.GoodsNO2);
                    $("#sGoodsNO3").val(data.GoodsNO3);
                }
            })
        }


        $("#changeGoodsInfo").click(function(){
            $.ajax({
                url:'changeGoodsInfo',
                type:"POST",
                dataType:"json",
                data:{
                    sGoodsDesc:$("#sGoodsDesc").val(),
                    sGoodsNO2:$("#sGoodsNO2").val(),
                    sGoodsNO3:$("#sGoodsNO3").val()
                },
                success:function(data) {
                    alert(data.success);
                }
            })
        });
    </script>
</body>
</html>